package com.aznest.mapper;

import com.aznest.entity.Collect;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作collect相关数据接口
*/
@Mapper
public interface CollectMapper {

    /**
      * 新增
    */
    int insert(Collect collect);

    @Select("select * from collect where user_id = #{id}")
    List<Collect> selectByUserId(Integer id);

    @Delete("delete from collect where id = #{id}")
    void deleteById(Integer id);

    @Select("select * from collect where user_id = #{userId} and hotel_id = #{hotelId}")
    List<Collect> selectByUserIdAndHotelId(Integer userId, Integer hotelId);

    List<Collect> selectAll(Collect collect);
}
